home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60src.lha / Vim / vim60 / src / testdir / test34.in < prev    next >
Encoding:
Text File  |  2000-11-22  |  547 b   |  32 lines

  1. Test for user functions
  2.  
  3. STARTTEST
  4. :so small.vim
  5. :function Table(title, ...)
  6. :  let ret = a:title
  7. :  let idx = 1
  8. :  while idx <= a:0
  9. :    exe "let ret = ret . a:" . idx
  10. :    let idx = idx + 1
  11. :  endwhile
  12. :  return ret
  13. :endfunction
  14. :function Compute(n1, n2, divname)
  15. :  if a:n2 == 0
  16. :    return "fail"
  17. :  endif
  18. :  exe "let g:" . a:divname . " = ". a:n1 / a:n2
  19. :  return "ok"
  20. :endfunction
  21. :let retval = "nop"
  22. /^here
  23. C=Table("xxx", 4, "asdf")
  24.  =Compute(45, 0, "retval")
  25.  =retval
  26.  =Compute(45, 5, "retval")
  27.  =retval
  28. :.wq! test.out
  29. ENDTEST
  30.  
  31. here
  32.